<?php

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
 * Nome: Adan Felipe Medeiros
 * Email: adan.grg@gmail.com
 * Data 13/04/2011
 *  
 */

class Utils {

    public function __construct() {

        //$this->criptografia = new CI_Encrypt();
    }

    public static function pr($vetor) {
        $exibe = "<pre>" . print_r($vetor) . "</pre>";
        echo $exibe;
    }

    public static function criptografa($string) {
        return base64_encode($string);   //$this->criptografia->encode($string);
    }

    public static function descriptografa($string) {
        return base64_decode($string);
    }

    public static function var_dump($obj) {
        $exibe = "<pre>" . var_dump($obj) . "</pre>";
        return $exibe;
    }
    
    public static function json_encode($json,$opcoes = null)
    {
        if(empty ($opcoes))
            return json_encode($json);
        else
            return json_encode ($json,$opcoes);
    }
    
    public static function json_decode($json)
    {
        return json_decode($json);
    }
    
    
}

?>